package com.cxyzy.demo

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.Composable
import androidx.ui.core.Text
import androidx.ui.core.setContent

class SecondActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            //获取字符串值
            val name = intent.getStringExtra("name")
            //获取整型值
            val age = intent.getIntExtra("age", 0)
            //获取布尔值
            val isOk = intent.getBooleanExtra("isOk", true)
            secondPage(name, age, isOk)
        }
    }
}

@Composable
fun secondPage(name: String?, age: Int, isOk: Boolean) {
    Text(text = "名字：$name；年龄：$age；isOk：$isOk")
}